#include "NearestTexturedRenderer.h"

void NearestTexturedRenderer::scan(unsigned char* p,int len,Interpolant base,Interpolant& diff)
{
    int u,v,index;
    for (;len > 0;len--,p+=3)
    {
        u=base.u*m_texw; u%=m_texw;
        v=base.v*m_texh; v%=m_texh;
        index=v*m_texw*4+u*4;
        p[0]=m_tex[index];//*base.r/255;
        p[1]=m_tex[index+1];//*base.g/255;
        p[2]=m_tex[index+2];//*base.b/255;
        base+=diff;
    }
}
